package com.alik.dao;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

@Repository(value = "userDao")
public class UserDao extends SqlSessionDaoSupport implements BaseDao {
    @Resource(name = "sessionFactory")
    public void setSessionFactory(SqlSessionFactory sessionFactory) {
        super.setSqlSessionFactory(sessionFactory);
    }
    
    @Override
    public List<Map> select(Map inMap) {
        List<Map> selectList = getSqlSession().selectList("user.selectUserById", inMap);
        return selectList;
    }
    
    @Override
    public int insert(Map inMap) {
        System.err.println(inMap);
        return 1;
        //return getSqlSession().insert("", inMap);
    }
    
}
